﻿using FluentValidation;

namespace FE.Shared.Validator
{
    public class MySqlSettingsValidator : AbstractValidator<MySqlSettings>
    {
        public MySqlSettingsValidator()
        {
            RuleFor(x => x.HostIp).NotNull().Length(1, 200);
            RuleFor(x => x.DatabaseName).NotNull().Length(1, 50);
            RuleFor(x => x.Password).NotNull().Length(1, 20);
            RuleFor(x => x.Username).NotNull().Length(1, 20);
            RuleFor(x => x.Port).NotNull().GreaterThan(0).LessThan(99999);
        }
    }
}